﻿using Autofac;
using System.Reflection;

namespace Vue3Net7.Config
{
    public class AutofacModuleRegister : Autofac.Module
    {
        /// <summary>
        /// 重写Autofac管道Load方法，在这里注册注入
        /// </summary>
        /// <param name="builder"></param>
        protected override void Load(ContainerBuilder builder)
        {                                                        
            Assembly interfaceAssembly = Assembly.Load("InterfaceService");
            Assembly serviceAssembly = Assembly.Load("Service");                                                      

            builder.RegisterAssemblyTypes(interfaceAssembly, serviceAssembly).AsImplementedInterfaces();
        }
    }
}
